package com.cvpoc.dto;

import java.io.Serializable;

import org.joda.time.DateTime;

public class FormationInitialeDTO implements Serializable {

	private static final long serialVersionUID = -7241803624615513436L;
	private int id;
	private int id_collaborateur;
	private DateTime dateDebut;
	private DateTime dateFin;
	private String libelle;

	public FormationInitialeDTO(DateTime dateDebut, DateTime dateFin, String libelle) {
		this.dateDebut = dateDebut;
		this.dateFin = dateFin;
		this.libelle = libelle;
	}

	public int getId_collaborateur() {
		return id_collaborateur;
	}

	public void setId_collaborateur(int id_collaborateur) {
		this.id_collaborateur = id_collaborateur;
	}

	public FormationInitialeDTO() {
		super();
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public DateTime getDateDebut() {
		return dateDebut;
	}

	public void setDateDebut(DateTime dateDebut) {
		this.dateDebut = dateDebut;
	}

	public DateTime getDateFin() {
		return dateFin;
	}

	public void setDateFin(DateTime dateFin) {
		this.dateFin = dateFin;
	}

	public String getLibelle() {
		return libelle;
	}

	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}

	@Override
	public String toString() {
		return "FormationInitiale [id=" + id + ", id_collaborateur="
				+ id_collaborateur + ", dateDebut=" + dateDebut + ", dateFin="
				+ dateFin + ", libelle=" + libelle + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((dateDebut == null) ? 0 : dateDebut.hashCode());
		result = prime * result + ((dateFin == null) ? 0 : dateFin.hashCode());
		result = prime * result + id;
		result = prime * result + id_collaborateur;
		result = prime * result + ((libelle == null) ? 0 : libelle.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FormationInitialeDTO other = (FormationInitialeDTO) obj;
		if (dateDebut == null) {
			if (other.dateDebut != null)
				return false;
		} else if (!dateDebut.equals(other.dateDebut))
			return false;
		if (dateFin == null) {
			if (other.dateFin != null)
				return false;
		} else if (!dateFin.equals(other.dateFin))
			return false;
		if (id != other.id)
			return false;
		if (id_collaborateur != other.id_collaborateur)
			return false;
		if (libelle == null) {
			if (other.libelle != null)
				return false;
		} else if (!libelle.equals(other.libelle))
			return false;
		return true;
	}
}
